package com.itheima.sc.service.sms;

import cn.hutool.core.convert.Convert;
import com.itheima.sc.api.sms.SmsCouponHistoryApi;
import com.itheima.sc.vo.PageResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class SmsCouponHistoryService {


    @DubboReference
    private SmsCouponHistoryApi couponHistoryApi;



    //根据优惠券id，使用状态，订单编号分页获取领取记录
    public PageResult couponHistoryList(Map<String, String> param) {

        String orderSn = param.get("orderSn");
        Integer page = Convert.toInt(param.get("pageNum"));
        Integer pageSize = Convert.toInt(param.get("pageSize"));
        Integer useStatus = Convert.toInt(param.get("useStatus"));
        Integer couponId = Convert.toInt(param.get("couponId"));
        return couponHistoryApi.couponHistoryList(page, pageSize,useStatus,couponId,orderSn);

    }
}
